#include "WidgetBarShell.h"
#include "../XXqtDefine.h"
#include <QBoxLayout>

WidgetBarShell::WidgetBarShell(QObject *parent)
    : QObject (parent)
    , _target(nullptr){

}
WidgetBarShell::~WidgetBarShell(){

}

void WidgetBarShell::shell(QWidget *widget){
    if(_target){
        XXDebug("can not shell again.");
        return;
    }

    _target = widget;
    //QBoxLayout *boxLayout = new QBoxLayout(QBoxLayout::Direction::TopToBottom, _target);
    _target->setLayoutDirection(Qt::LayoutDirection::LeftToRight);
    _target->layout()->setSpacing(0);
    _target->layout()->setMargin(0);

    _scrollArea = new QScrollArea(_target);
    _target->layout()->addWidget(_scrollArea);
    QBoxLayout *boxLayout = new QBoxLayout(QBoxLayout::Direction::TopToBottom, _target);
}
void WidgetBarShell::shell(QBoxLayout *layout){

}
